package interactive.states
{
	import events.GestureEvent;
	
	import flash.geom.Point;
	
	import interactive.GestureManager;
	import interactive.HandType;

	/**
	 *
	 * 移动状态
	 * 1. 如果离开则进入等待停止移动状态
	 * 2. 如果移动则触发移动事件
	 *  
	 * @author Raykid
	 * 
	 */
	public class MoveState implements IGestureState
	{
		public function MoveState()
		{
		}

		public function backIn(manager:GestureManager, point:Point):void {
			// 无操作
		}
		public function switchIn(manager:GestureManager, point:Point):void
		{
			// 无操作
		}
		public function switchOut(manager:GestureManager, point:Point):void
		{
			// 无操作
		}
		public function touch(manager:GestureManager, point:Point):void
		{
			// 无操作
		}
		public function leave(manager:GestureManager, point:Point):void
		{
			// 1. 如果离开则进入等待停止移动状态
			manager.switchState(manager.waitStopMoveState, point);
		}
		public function move(manager:GestureManager, point:Point):void
		{
			// 2. 如果移动则触发移动事件
			manager.moveDispatcher.dispatchEvent(new GestureEvent(GestureEvent.MOVE, manager.moveTarget, true, false, point.x, point.y));
		}
		public function toString():String {
			return "MoveState";
		}
	}
}